package ink.ykb.actDemo.config;

import javax.sql.DataSource;

import org.activiti.engine.HistoryService;
import org.activiti.engine.IdentityService;
import org.activiti.engine.ManagementService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ActivitiConfig {
/*
	//流程配置
	@Bean(name="processEngineConfiguration")
	public ProcessEngineConfiguration processEngineConfiguration(DataSource dataSource){
		
		StandaloneProcessEngineConfiguration processEngineConfiguration = new StandaloneProcessEngineConfiguration();
		processEngineConfiguration.setDataSource(dataSource);
		processEngineConfiguration.setDatabaseSchemaUpdate("false");
//		processEngineConfiguration.setDatabaseSchemaUpdate("drop-create");
		
		return processEngineConfiguration;
	}
	//流程引擎
	@Bean
	public ProcessEngine getProcessEngine(ProcessEngineConfiguration processEngineConfiguration) {
		return processEngineConfiguration.buildProcessEngine();
	}
	//流程服务
	@Bean
	public RepositoryService getRepositoryService(ProcessEngine processEngine) {
		return processEngine.getRepositoryService();
	}
	@Bean
	public RuntimeService getRuntimeService(ProcessEngine processEngine) {
		return processEngine.getRuntimeService();
	}
	@Bean
	public TaskService getTaskService(ProcessEngine processEngine) {
		return processEngine.getTaskService();
	}
	@Bean
	public HistoryService getHistoryService(ProcessEngine processEngine) {
		return processEngine.getHistoryService();
	}
	@Bean
	public ManagementService getManagementService(ProcessEngine processEngine) {
		return processEngine.getManagementService();
	}
	@Bean
	public IdentityService getIdentityService(ProcessEngine processEngine) {
		return processEngine.getIdentityService();
	}
	*/


}
